<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="__CSS__/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__/style.css" />
    <script type="text/javascript" src="__CSS__/ckeditor/ckeditor.js"></script>
    <script type="text/javascript" src="__JS__/jquery.js"></script>
    <script type="text/javascript" src="__JS__/jquery.sorted.js"></script>
    <script type="text/javascript" src="__JS__/bootstrap.js"></script>
    <script type="text/javascript" src="__JS__/ckform.js"></script>
    <script type="text/javascript" src="__JS__/common.js"></script>
    <script type="text/javascript">
    function getcity(){  
    	$("#city").empty();  
        var a = $("#pro").val();  
        $.post("/Admin/News/showcity?code="+a,{code: a},  
            function(data){  
                var obj = eval('('+data+')');
             
                $("#city").empty();  
                $("#city").prepend("<option value='-1'>请选择市</option>");           
                for(var p in obj){  
                	$("#city").append("<option value="+obj[p].code+">"+obj[p].name+"</option>"); 
                }  
            }  
        );    
    } 
   
    </script>
    
    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }


    </style>
</head>
<form action="/Admin/News/editOK?id={$news.id}" method="post"  enctype="multipart/form-data">
<input type = "hidden" name="partner_id" value = "{$id}"/>
<h2>添加广告</h2>
<table class="table table-bordered table-hover definewidth m10">
    <tr>
        <td width="10%" class="tableleft">标题</td>
      <td>
       <input type="text" name="title" style="width:200px;" value="{$news.title}"/>
      </td>
    </tr>
   
    <tr>
        <td class="tableleft">简介</td>
        <td>
            <input type="text" name="profile" style="width:200px;" value="{$news.profile}"/>
        </td>
    </tr>   

    <tr>
        <td width="10%" class="tableleft">链接地址</td>
        <td>
        <input type="text" name="url" style="width:200px;" value="{$news.url}"/>
        </td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">图片</td>
        <td><input type="file" size="30" name="image"/><img src="/Uploads/{$news.thumb_image}"/></td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">城市及分类*</td>
				<td>
					<select name="province" id="pro" onchange="getcity()">
						<option>请选择省</option>
						<volist name="data" id="v">			
							<option value="{$v[code]}" <if condition=" $v.code eq $news.prov_id "> selected</if>>{$v[name]}</option>
						</volist>
						
					</select>
					<select name="city" id="city">
						<option>请选择市</option>
						<volist name="city" id="vo">			
							<option value="{$vo[code]}" <if condition=" $vo.code eq $news.city_id "> selected</if>>{$vo[name]}</option>
						</volist>
					</select>
				</td>
			</tr>
     <tr>
    <tr>
        <td class="tableleft"></td>
        <td>
            <button type="submit" class="btn btn-primary" type="button">保存</button>&nbsp;&nbsp;<button type="button" class="btn btn-success" name="backid" id="backid">返回列表</button>
        </td>
    </tr>
</table>
</form>
</body>
</html>
<script>
    $(function () {       
		$('#backid').click(function(){
				window.location.href="index.html";
		 });

    });
</script>